package com.cgwx.tmservice.netty;

import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author GaoWei
 * @Date 2023/8/29 - 17:36
 */
@Component
public class NettyCanUdpReceiveServerHandlerInitializer extends ChannelInitializer<Channel> {

    @Autowired
    NettyCanUdpReceiveHandler nettyCanUdpReceiveHandler;

    @Override
    protected void initChannel(Channel channel) {
        ChannelPipeline channelPipeline = channel.pipeline();
        channelPipeline.addLast("nettyCanUdpHandler", nettyCanUdpReceiveHandler);
    }
}
